"""
ASGI config for psychology_project project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
"""

# import os
#
# from django.core.asgi import get_asgi_application
#
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "psychology_project.settings")
#
# application = get_asgi_application()

# import os
# from django.core.asgi import get_asgi_application
# from channels.routing import ProtocolTypeRouter, URLRouter
# from channels.auth import AuthMiddlewareStack
# from django.urls import re_path
#
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'psychology_project.settings')
#
# # 获取 Django ASGI 应用
# django_asgi_app = get_asgi_application()
#
# # 导入路由（我们稍后创建）
# from psychology_chat import routing
#
# application = ProtocolTypeRouter({
#     "http": AuthMiddlewareStack(
#         URLRouter([
#             # HTTP 路由
#             *routing.http_urlpatterns,
#             # 默认 HTTP 处理
#         ] + [
#             # 捕获所有其他 HTTP 请求
#             re_path(r'^', django_asgi_app),
#         ])
#     ),
# })
import os
from django.core.asgi import get_asgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'psychology_project.settings')

# 获取标准的 Django ASGI 应用
application = get_asgi_application()
